#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int arr[10000];
int sup_int[1006];
int main()
{
	int n; int i,j;
	int rem = 0;
	scanf("%d", &n);
	int digit = n;
	for (i = 2, j = 0; rem + i <= n; i++,j++){
		rem += i;
		arr[j] = i;
	}
	if (rem < n) {
		i = n - rem - 1;
		while (1) {
			for (int m = j - 1;m >= 0; m--, i--) {
				arr[m]++;
				if (i <= 0)goto out;
			}
		}
	}
out:;
	sup_int[0] = 1;
	for (int m = 0; m < j; m++) {
		for (int q = 0; q < 1002; q++) {
			sup_int[q] *= arr[m];
		}
		for (int q = 0; q < 1002; q++) {
			if (sup_int[q] > 9) {
				sup_int[q + 1] = sup_int[q + 1] + sup_int[q] / 10;
				sup_int[q] %= 10;
			}
		}
	}
	for (int m = 0; m < j; m++) {
		printf("%d ", arr[m]);
	}
	printf("\n");
	int m;
	for (m = 1001; sup_int[m] == 0; m--);
	for (; m >= 0; m--)
		printf("%d", sup_int[m]);
	return 0;
}